/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.sales.hancadpo.client.service;

import br.com.sales.generics.client.HanRequestBuilder;
import br.com.sales.generics.client.request.HannaRequestCallback;
import com.google.gwt.json.client.JSONArray;
import com.google.inject.Inject;
import java.util.Map;

/**
 *
 * @author v
 */
public class HanCadPOService {

    @Inject
    private HanRequestBuilder requestProxy;

    public void insertProduct(Map fields, HannaRequestCallback callback) {
        JSONArray array = new JSONArray();
        array.set(0, requestProxy.formatJson(fields));

        requestProxy.sendRequest("HanCadPO", "insertProduct", array, callback);
    }

    public void getDateGrid(Integer page, HannaRequestCallback callback) {
        JSONArray array = new JSONArray();
        array.set(0, requestProxy.formatJson(page));

        requestProxy.sendRequest("HanCadPO", "getDateGrid", array, callback);
    }

    public void getRefreshDateGrid(Map items, HannaRequestCallback callback) {
        JSONArray array = new JSONArray();
        array.set(0, requestProxy.formatJson(items));

        requestProxy.sendRequest("HanCadPO", "getRefreshDateGrid", array, callback);
    }

    public void inactivate(Long sequence, HannaRequestCallback callback) {
        JSONArray array = new JSONArray();
        array.set(0, requestProxy.formatJson(sequence));

        requestProxy.sendRequest("HanCadPO", "inactivate", array, callback);
    }
}
